/**
 * Simple sensor emulator that just outputs a sensed data from SWARM environment 
 * by Mina Jung
 */
  

generic module EMSSensorC(typedef width_t @integer()) { 
  provides interface Read<width_t>;
}
implementation
{
  width_t type;

  task void senseResult() {
    width_t s_val = get_sensed_value(sim_node(), type);
    signal Read.readDone(SUCCESS, type, s_val);
  }

  command error_t Read.read(width_t t) {
    type = t;
    return post senseResult();
  }
}
